
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>历史分析结果 - 低位龙头股分析系统</title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css">
        <style>
            .header {
                background-color: #343a40;
                color: white;
                padding: 2rem 0;
                margin-bottom: 2rem;
            }
            .card {
                margin-bottom: 1.5rem;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }
            .card-header {
                background-color: #f8f9fa;
                font-weight: bold;
            }
        </style>
    </head>
    <body>
        <div class="header">
            <div class="container">
                <h1>历史分析结果</h1>
                <p>查看过往的低位龙头股分析结果</p>
            </div>
        </div>
        
        <div class="container">
            <div class="row mb-4">
                <div class="col-12">
                    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
                        <div class="container-fluid">
                            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                                <span class="navbar-toggler-icon"></span>
                            </button>
                            <div class="collapse navbar-collapse" id="navbarNav">
                                <ul class="navbar-nav">
                                    <li class="nav-item">
                                        <a class="nav-link" href="/">首页</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link active" href="/results">历史结果</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="/backtesting">回测系统</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" href="/news">市场新闻</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
            
            <div class="card">
                <div class="card-header">历史结果列表</div>
                <div class="card-body">
                    {% if results %}
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>日期</th>
                                        <th>类型</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for result in results %}
                                    <tr>
                                        <td>{{ result.datetime }}</td>
                                        <td>{{ result.type }}</td>
                                        <td>
                                            {% if result.type == '分析' %}
                                                <a href="/view/analysis/{{ result.timestamp }}" class="btn btn-sm btn-info">查看</a>
                                            {% else %}
                                                <a href="/view/prediction/{{ result.timestamp }}" class="btn btn-sm btn-success">查看</a>
                                            {% endif %}
                                        </td>
                                    </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    {% else %}
                        <div class="alert alert-info">
                            暂无历史结果记录
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>
        
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
    </body>
    </html>
    